package cn.lynu.study.practice11_30;

class Thread001 extends Thread{
	public void run() {
		for(int i = 1;i<=15;i++) {
			System.out.println("thread one");
			try {Thread.sleep(2000);} catch (InterruptedException e) {}
		}
	}
}


//2 Runnableӿ
class MyRunnable implements Runnable{
	public void run() {
		for(int i = 1;i<=15;i++) {
			System.out.println("thread two");
			try {Thread.sleep(2000);} catch (InterruptedException e) {}
		}
	}
}

public class Main01 {
	public static void main(String[] args) {
		Thread001 thread1 = new Thread001();
		MyRunnable myRunnable = new MyRunnable();
		Thread thread2=new Thread(myRunnable,"߳2");
		thread1.start();//߳1
		thread2.start();//߳2
		
		for(int i = 1;i<=15;i++) {
			System.out.println("main");
		}
	}
}
